package com.ruyuan2020.im.chat.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruyuan2020.im.chat.dao.ChatDAO;
import com.ruyuan2020.im.chat.domain.ChatDO;
import com.ruyuan2020.im.common.web.dao.MybatisPlusDAOImpl;
import com.ruyuan2020.im.chat.mapper.ChatMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhonghuashishan
 */
@Repository
public class ChatDAOImpl extends MybatisPlusDAOImpl<ChatMapper, ChatDO> implements ChatDAO {

    @Override
    public List<ChatDO> list(Long accountId) {
        LambdaQueryWrapper<ChatDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ChatDO::getAccountId,accountId);
        return mapper.selectList(queryWrapper);
    }
}